package com.util.assertUtil;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/1/28 21:17
 */
public final class AssertUtil<T> {

    public static void AssertNotNull(Object obj) throws NullPointException {
        if (obj == null) {
            throw new NullPointException();
        }
    }

//    //? super E_OUT
//    public static <T>void AssertNotNull(Assert<T> asser) throws NullPointException {
//        T x = null,y = null;
//        if (asser.AssertExpression(x,y)) {
//            throw new NullPointException();
//        }
//        System.out.println();
//    }

    public static <T>void AssertNotNull(T x, T y, Assert<T> asser) throws NullPointException {
        if (asser.AssertExpression(x,y)) {
            throw new NullPointException();
        }
        System.out.println();
    }

    public static <T>void AssertNotNullByDoAssert(T x, T y, Assert<T> asser) throws NullPointException {
        if (asser.doAssert(x, y ,asser)) {
            throw new NullPointException();
        }
        System.out.println();
    }
}
